package com.glsx.auto;

import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;

import java.io.File;

/**
 * Created by linxy on 2017/4/21.
 */

@Mojo(name = "auto-update",
        aggregator = true, // --non-recursive
        defaultPhase = LifecyclePhase.GENERATE_SOURCES
)
public class AutoUpdateMojo extends AbstractAutoMojo  {
    @Override
    public void process() {

        if(!new File(common.getModuleDirectory()).exists()) {
            return;
        }

        if(!new File(container.getModuleDirectory()).exists()) {
            return;
        }

        updateOrCreateSrc();
    }
}
